package com.esri.core.internal.tasks.ags;

import com.esri.core.internal.tasks.TaskListener;
import com.esri.core.io.EsriServiceException;
import com.esri.core.io.UserCredentials;
import com.esri.core.map.FeatureEditResult;
import java.util.ArrayList;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class b extends com.esri.core.internal.tasks.d<FeatureEditResult[]> {
    private static final long serialVersionUID = 1;

    public b(c cVar, String str, UserCredentials userCredentials, TaskListener<FeatureEditResult[]> taskListener) {
        super(cVar, str, userCredentials, taskListener);
    }

    public b(c cVar, String str, UserCredentials userCredentials) {
        super(cVar, str, userCredentials);
    }

    @Override // com.esri.core.internal.tasks.a
    /* renamed from: a */
    public FeatureEditResult[] execute() throws Exception {
        c cVar = (c) this.actionInput;
        JsonParser a = com.esri.core.internal.io.handler.h.a(this.serviceURL + '/' + cVar.a() + "/deleteAttachments", cVar.generateRequestParams(), false, getServiceCredentials());
        ArrayList arrayList = new ArrayList();
        if (!com.esri.core.internal.util.d.c(a)) {
            throw new EsriServiceException("Unable to parse the result response.");
        }
        while (a.nextToken() != JsonToken.END_OBJECT) {
            String currentName = a.getCurrentName();
            a.nextToken();
            if ("deleteAttachmentResults".equals(currentName)) {
                if (a.getCurrentToken() == JsonToken.START_ARRAY) {
                    arrayList.clear();
                    while (a.nextToken() != JsonToken.END_ARRAY) {
                        arrayList.add(FeatureEditResult.fromJson(a));
                    }
                }
            } else {
                a.skipChildren();
            }
        }
        a.close();
        return (FeatureEditResult[]) arrayList.toArray(new FeatureEditResult[0]);
    }
}
